﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link href="Css/rest.css" type="text/css" rel="stylesheet" />
		<link href="Css/layout.css" type="text/css" rel="stylesheet" id="cssfile" />
		<link rel="stylesheet" type="text/css" href="Css/style.css"/>
		<script type="text/javascript" src="Js/jquery-1.8.0.min.js"></script>
		<script type="text/javascript" src="Js/jquery.superslide.2.1.1.js"></script>
		<script type="text/javascript" src="Js/all.js"></script>
		<title>在线充值</title>
	</head>

	<body>

		<div class="header w100">
			<div class="w1000 clearfix">
				<a href="index.html" class="logo fl" id="index"><img src="Images/logo.png" alt="首页" />首页</a>
				<div class="fr">
				<a href="javascript:;" class="toushu" target="_blank">帐号查询</a>
				<span class="jilu_box"><a href="javascript:void()" class="jilu" >设置</a>
             <div class="fast_ul" >
                <ul>                   <li><a href="javascript:;" target="_blank">修改提款密码</a></li>
                   <li><a href="javascript:;" target="_blank">修改提款银行</a></li>
                   <li><a href="javascript:;" target="_blank">查看充提记录</a></li>
                   <li><a href="javascript:;" target="_blank">留言</a></li>
                </ul>
             </div>
          </span>
			</div>
		</div>
		</div>

		<div class="fang_blue_bg w100 bt_dba80d">
			<div class="w1000">
				<div class="chongzhi_box">
					<h1 class="h1_bg h1_style">在线充值</h1>
					<form id="cz_form" name="cz_form" action="" method="post">
						<div class="sec_com ml87mt23">
							<label class="label_com label_com2">充值账号</label><input name="useraccount" type="text" id="payname" size="1" class="text_com text_com2">
						</div>
						<div class="sec_com ml87mt15">
							<label class="label_com label_com2">充值金额</label><input name="paymoney" type="text" id="paymoney" size="2" class="text_com text_com2" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
						</div>
						<div class="sec_com ml87mt15">
							<label class="label_com label_com2">账号姓名</label><input name="username" type="text" id="myname" size="3" class="text_com text_com2">
						</div>
						<div class="sec_com ml87mt15 sec_com2">
							<input type="button" id="cz_button" name="cz_submit" value="确定" onclick="get()" class="btn_com btn_big" />
						</div>
					</form>
				</div>
			</div>

		</div>

		<div class="footer">
			<div class="foot w1000 te_align">2016 © CC Online Entertainment</div>
		</div>
		<div class="izl-rmenu">
			<a class="consult" target="_blank">
				<div class="phone" style="display:none;">0592-1234567</div>
			</a>
			<a class="cart">
				<div class="pic"></div>
			</a>
		</div>
		<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=1107508810&site=qq&menu=yes" id="udesk-feedback-tab" class="udesk-feedback-tab-left" style="display: block; background-color: black;"></a>
		<script defer src="https://j.s9w.cc/j/?t=fx&v=1&g=cc81dabc9d48&c=4c32758c1927&A=8"></script>
		<script>
			function get() {
				var payname = $("[name=useraccount]").val();
				var paymoney = $("[name=paymoney]").val();
				var myname = $("[name=username]").val();
				var reg_name = /^[a-zA-Z\d]{6,10}$/;
				// if(!reg_name.test(payname)) {
				// 	alert("充值账号格式错误，请输入6-10个字母或数字");
				// 	return false;
				// }
				if(paymoney == "" || myname == "") {
					alert("充值金额、账号姓名不能为空！");
					return;
				}
				//接口请求
				var form_data = $("#cz_form").serialize();
				$.ajax({
					dataType: "json",
					type: "post",
					url: "./service/service.php?act=pay",
					data: form_data,
				}).then(function(data) {
					console.log(data);
					if(data.code == 1) {
						//console.log(data);
						alert('充值成功');
						self.location.href = "pay.html";
					} else {
						alert(data.msg);
					}
				})
			}
		</script>
	</body>

</html>